<?php

namespace Part06_DecorationMode\Code4;

require_once '../../autoload.php';

$p = (new Person())->setname('张三');

echo "第一种装扮:\n";

$sneakerObj = new Sneakers();
$bigTrouserObj = new BigTrouser();
$tShirtsObj = new TShirts();

$sneakerObj->decorator($p);
$bigTrouserObj->decorator($sneakerObj);
$tShirtsObj->decorator($bigTrouserObj);
$tShirtsObj->show();

echo "\n\n------------\n\n";

echo "第二种装扮:\n";
$leatherShoesObj = new LeatherShoes();
$tieObj = new Tie();
$suitObj = new Suit();

$leatherShoesObj->decorator($p);
$tieObj->decorator($leatherShoesObj);
$suitObj->decorator($tieObj);
$suitObj->show();

